#include <string.h>
#include <Includes.h>
#include <DRV_EC600S.h>
#include <DRV_EC600S_CB.h>
#include <OPP_Debug.h>
#include <OPP_ErrorCode.h>
//#include <SVS_Coap.h>

U8 g_ucEc600sDevInit = 0;

int Ec600sDevStateChgCallback(void)
{
	U8 devSt;

	devSt = Ec600sStGet();
	if(EC600S_DEV_READY== devSt){
		if(!g_ucEc600sDevInit){
            //Add Your Online message here
            //noted by wangtao
			//ApsCoapOceanconOnline(CHL_NB,NULL);
			g_ucEc600sDevInit = 1;
		}
	}

	return OPP_SUCCESS;
}

/**
@brief ec600s注册状态变化回调函数
@return 0成功，非0失败
**/
int Ec600sRegStateChgCallback(void)
{
    EN_REG_STATE regStatus;
	/*注册状态*/
    regStatus = Ec600sRegStGet();
    DEBUG_LOG(DEBUG_MODULE_EC600S, DLL_INFO, "Ec600sStateChg reg=%d\r\n", regStatus);
	if((NOT_REG == regStatus) || (TRY_REG == regStatus) || (UNKNOW_REG == regStatus) || (DENY_REG == regStatus))
	{
        //事件日志30分钟内断网次数
        Ec600sDisConTimesAdd(1);
        //复位后总断网次数
        Ec600sAllDisConTimesAdd(1);
	}else if(REG == regStatus||ROAMING_REG){

    }
	return 0;
}


